{include file="common_top.html"}
{include file="common_head.html"}
{include file="common_center.html"}
<div class="app-wrapper">
	{include file="common_appheader.html"}
	<div class="app-body">
		<div class="content clearfix">
			<div class="page-support_resetpassword">
				<div class="nav clearfix">
					<div class="item">重置密码</div>
				</div>
				<div class="block-support">
					<form action="/index.php?a=support&m=resetpassword&t=ajax" method="post" name="form_resetpassword">
						<input type="hidden" name="key" value="{$key}" />
						<table>
							<tr class="passwordnew"><td class="title">新密码</td><td class="control">
								<label><input type="password" name="passwordnew" class="dy-text" /></label>
							</td><td class="message"><span></span></td></tr>
							<tr><td></td><td class="notice" colspan="2"></td></tr>
							<tr class="passwordcfm"><td class="title">确认新密码</td><td class="control">
								<label><input type="password" name="passwordcfm" class="dy-text" /></label>
							</td><td class="message"><span></span></td></tr>
							<tr><td></td><td class="notice" colspan="2"></td></tr>
							<tr class="pagesubmit"><td class="btn" colspan="2"><span class="message"><span></span></span><input type="submit" class="dy-button blue" value="确定" /></td><td></td></tr>
						</table>
					</form>
				</div>
				<div class="loading"></div>
			</div>
		</div>
	</div>
	{include file="common_appfooter.html"}
</div>
<script type="text/javascript">
{literal}
$(function(){
	// 提交表单
	$("form[name=form_resetpassword]").submit(function(){
		$.fn.dyAjaxForm(this, {dataType: "JSON", onEvent: {beforeSend:function(){
			$(".page-support_resetpassword .loading").show(300);
		}, success: function(result){
			if(result.state){
				window.location.href = result.url;
			}else{
				for(var k in result.message){
					if($(".page-support_resetpassword ." + k + " .message span").length){
						$(".page-support_resetpassword ." + k + " .message span").html(result.message[k]).show(300);
						$("body").one('mousedown', function(){
							$(".page-support_resetpassword ." + k + " .message span").hide(300);
						});
					}else{
						$(".page-support_resetpassword .pagesubmit .message span").html(result.message[k]).show(300);
						$("body").one('mousedown', function(){
							$(".page-support_resetpassword .pagesubmit .message span").hide(300);
						});
					}
				}
			}
			$(".page-support_resetpassword .loading").hide(300);
		}, error: function(jqXHR, textStatus, errorThrown){
			$(".page-support_resetpassword .pagesubmit .message span").show(300).html("AJAX请求错误[" + errorThrown + "]。");
			$("body").one('mousedown', function(){
				$(".page-support_resetpassword .pagesubmit .message span").hide(300);
			});
			$(".page-support_resetpassword .loading").hide(300);
		}}});

		return false;
	});
});
{/literal}
</script>
{include file="common_bottom.html"}
